import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: 'CMS标签码',
    align:"center",
    dataIndex: 'barinfo'
   },
   {
    title: '请求时间',
    align:"center",
    dataIndex: 'requestTime'
   },
   {
    title: '请求处理状态',
    align:"center",
    dataIndex: 'status'
   },
   {
    title: '错误信息',
    align:"center",
    dataIndex: 'errorMessage'
   },
   {
    title: '成功信息',
    align:"center",
    dataIndex: 'successMessage'
   },
   {
    title: '物料编号',
    align:"center",
    dataIndex: 'materialcode'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: 'CMS标签码',
    field: 'barinfo',
    component: 'Input',
  },
  {
    label: '请求时间',
    field: 'requestTime',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '请求处理状态',
    field: 'status',
    component: 'Input',
  },
  {
    label: '错误信息',
    field: 'errorMessage',
    component: 'Input',
  },
  {
    label: '成功信息',
    field: 'successMessage',
    component: 'Input',
  },
  {
    label: '物料编号',
    field: 'materialcode',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  barinfo: {title: 'CMS标签码',order: 0,view: 'text', type: 'string',},
  requestTime: {title: '请求时间',order: 1,view: 'datetime', type: 'string',},
  status: {title: '请求处理状态',order: 2,view: 'text', type: 'string',},
  errorMessage: {title: '错误信息',order: 3,view: 'text', type: 'string',},
  successMessage: {title: '成功信息',order: 4,view: 'text', type: 'string',},
  materialcode: {title: '物料编号',order: 5,view: 'text', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}